-- GENERATED SPELL FOR [Ethereum Avenger] --


function spell0_22821(pUnit, Event) --@Battle Shout,Self--
pUnit:FullCastSpellOnTarget(32064,pUnit)
pUnit:RegisterEvent('Sorts_22821', 622, 1)
end

function spell1_22821(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(36509,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22821', 2259, 1)
end

function spell2_22821(pUnit, Event) --@Enchanted Weapons,n/a--
pUnit:FullCastSpellOnTarget(39489,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22821', 30000, 1)
end

function Sorts_22821(pUnit, Event)
local choix_sorts_22821 = math.random(0, 2)
if choix_sorts_22821 == 0 then
pUnit:RegisterEvent('spell0_22821', 1, 1)
end
if choix_sorts_22821 == 1 then
pUnit:RegisterEvent('spell1_22821', 1, 1)
end
if choix_sorts_22821 == 2 then
pUnit:RegisterEvent('spell2_22821', 1, 1)
end
end

function mob22821_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22821', math.random(1500, 3000), 1)
end

function mob22821_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22821_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22821_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22821, 1, 'mob22821_Action')
RegisterUnitEvent(22821, 2, 'mob22821_Leave')
RegisterUnitEvent(22821, 3, 'mob22821_Kill')
RegisterUnitEvent(22821, 4, 'mob22821_Die')
